<template>
	<!-- index.wxml -->
	<view class="home-page" :style="objColor" style="padding-bottom: 150rpx;">

		<!-- 全屏广告 -->
		<template v-if="advertisingSwitch">
			<FullscreenAd />
		</template>

		<customer :existTabBar="true" ref="customerRef"></customer>
		<!-- <customNavigationBar :title="appName"></customNavigationBar> -->
		<view class="search-box" :style="'height:' + searchBoxHeight + 'px;'">
			<!-- <text>1212333</text>      -->
			<!-- <image class="header-image" src="https://oos-cn.ctyunapi.cn/front-end/static/cartoon/orderBg.png"></image> -->
			<image class="header-image" :src="(mixOtherIconList[5] && mixOtherIconList[5].icon)"></image>
			<!-- 搜索 -->
			<customNavigationBar v-if="nameShow"></customNavigationBar>
		
			<view class="search" :style="'top:' + searchTagTop + 'px;'">
				<view class="location" @click="goArea">
					<view class="locationName">{{ cityname || '请选择' }}</view>
					<view class="down"></view>
					<!-- <image class="img2" src="https://oos-cn.ctyunapi.cn/front-end/static/homeSub/images/down.png"></image> -->
				</view>
				<view style="width: 74%">
					<!-- 搜索框 -->
					<view class="weui-search-bar">
						<view class="weui-search-bar__form">
							<!-- 点击之后，跳转搜索页面 -->
							<view class="weui-search-bar__box">
								<icon class="weui-icon-search_in-box" type="search" size="16"></icon>
								<input type="text" class="weui-search-bar__input" placeholder="输入站点名称/地点名称" @tap="goSearch" />
							</view>
						</view>
					</view>
				</view>
				<view @tap="goNotice">
					<image class="img"
						:src="(mixOtherIconList[2] && mixOtherIconList[2].icon) || 'https://oos-cn.ctyunapi.cn/front-end/static/static/information.png'">
					</image>
					<text class="tipInfo" v-if="readStatus"></text>
				</view>
			</view>
		</view>
		<!-- 头部 star -->
		<view class="header" style='margin-top: 20rpx;'>
			<view class="header-top">
				<!-- banner -->
				<view v-if="lunbao.length">
					<!-- <image class="header-image2" src="https://oos-cn.ctyunapi.cn/front-end/static/cartoon/home_bgB.png"></image> -->
					<swiper class="swiper-banner" :indicator-dots="indicatorDots" :autoplay="autoplay"
						:circular="circular" :vertical="vertical" :interval="interval" :duration="duration"
						indicator-color="rgba(255, 255, 255, 0.4)" indicator-active-color="#fff">
						<!-- <view > -->
						<swiper-item v-for="(item, index) in lunbao" :key="index" @tap="advertisingLink"
							:data-title="item.title" :data-status="item.status" :data-time="item.timeS"
							:data-link="item.advertisingLink" :data-type="item.connectionType"
							:data-path="item.mobilePath" :data-details="item.details" :data-id="item.id"
							:data-atype="item.activityType" :data-mid="item.marketingId">
							<image :src="item.image" mode="aspectFill" class="swiper-item-images" />
						</swiper-item>
						<!-- </view> -->
					</swiper>
				</view>
			</view>
		</view>
		<view v-if="pageApiObj">
			<!-- 自定义模块  左侧是钱包 -->
			<view class="info" v-if="isWallet && indexSwitch">
				<!-- 未登录 -->
				<view class="user_info" v-if="!isLogin">
					<view class="price">****</view>
					<view class="status">账号余额(元)</view>
					<view class="status">平均单笔充电(元)：****</view>
					<view class="recharge" @tap="goLogin">去登录</view>
					<image class="fleet" src="https://oos-cn.ctyunapi.cn/front-end/static/static/fleet2.png"></image>
				</view>
				<!-- 已登录 -->
				<view class="user_info" v-else>
					<template v-if="personage.tokenMemberType == 0">
						<view @click="goPersonalAccount">
							<view class="price">{{ personage.accountBalance }}</view>
							<view class="status">账户金额(元)</view>
						</view>

						<view class="status">
							平均单笔充电(元)：
							<text class="showCharg">{{ personage.personageAvgChargeFee }}</text>
						</view>
						<view class="recharge" @tap="goPersonalAccount2">去充值</view>
					</template>
					<template v-else>
						<view @click="goPersonalAccount1">
							<view class="price">
								{{ personage.deductMode == 'TeamAccount' ? '****' : personage.carAccountBalance }}
							</view>
							<view class="status">车队账号(元)</view>
						</view>

						<view class="status">
							平均单笔充电(元)：
							<text class="showCharg">{{ personage.carAvgChargeFee }}</text>
						</view>
						<view class="recharge2"></view>
					</template>
					<image class="fleet" src="https://oos-cn.ctyunapi.cn/front-end/static/static/fleet2.png"></image>
				</view>
				<!-- 已登录并是车队身份 -->
				<!-- <view class="user_info" v-if="isLogin && personage.memberType != 0">
					<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_1.png"></image>
					<view class="info1">
						<view @tap="goPersonalAccount1">
							<view class="num">
								{{ personage.deductMode == 'TeamAccount' ? '****' : personage.carAccountBalance }}
							</view>
							<view class="text">车队余额</view>
						</view>
						<view style="margin-left: 68rpx" @tap="goPersonalAccount">
							<view class="num">{{ personage.accountBalance }}</view>
							<view class="text">个人余额</view>
						</view>
					</view>
					<view class="recharge" @tap="goPersonalAccount">去充值</view>
					<image class="fleet" src="https://oos-cn.ctyunapi.cn/front-end/static/static/fleet.png"></image>
				</view> -->
				<view>
					<view class="modular" @tap="naviToOrderList">
						<image class="img"
							:src="configHomeIcon.MY_ORDER_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_2.png'">
						</image>
						<view>
							<view class="txt1">我的订单</view>
							<view class="txt2">查看我的订单</view>
						</view>
					</view>
					<!-- isCard 是不是收藏 -->
					<view class="modular" style="margin-top: 16rpx" @tap="goCollectionList" v-if="!isCard">
						<image class="img"
							:src="configHomeIcon.MY_COLLECT_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_3.png'">
						</image>
						<view>
							<view class="txt1">我的收藏</view>
							<view class="txt2">查看我的收藏</view>
						</view>
					</view>
					<view class="modular" style="margin-top: 16rpx" @tap="naviCard" v-if="isCard">
						<image class="img"
							:src="configHomeIcon.MY_COUPON_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_3.png'">
						</image>
						<view>
							<view class="txt1">我的卡券</view>
							<view class="txt2">查看我的卡券</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 全通模板  左侧订单 -->
			<view class="info" v-if="!isWallet && indexSwitch">
				<view class="user_info all_info" @tap="goOrder">
					<image class="img"
						:src="configHomeIcon.MY_ORDER_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_1.png'">
					</image>
					<view class="status">我的订单</view>
					<view class="status dingdan">查看我的订单</view>
					<view class="recharge" style="border: none"></view>
					<image class="fleet" src="https://oos-cn.ctyunapi.cn/front-end/static/static/fleet.png"></image>
				</view>
				<view>
					<view class="modular" style="margin-top: 16rpx" @tap="goCollectionList">
						<image class="img"
							:src="configHomeIcon.MY_COLLECT_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_3.png'">
						</image>
						<view>
							<view class="txt1">我的收藏</view>
							<view class="txt2">查看我的收藏</view>
						</view>
					</view>
					<view class="modular" @tap="naviCard">
						<image class="img"
							:src="configHomeIcon.MY_COUPON_ICON || 'https://oos-cn.ctyunapi.cn/front-end/static/static/home_icon_2.png'">
						</image>
						<view>
							<view class="txt1">我的卡券</view>
							<view class="txt2">查看我的卡券</view>
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 滚动通告 -->
		<view class="message" v-if="message">
			<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/new2.png"></image>
			<swiper class="message-swiper" :circular="true" :vertical="true" :autoplay="true" interval="3000"
				duration="1000">
				<swiper-item v-for="(item, index) in noticeList" :key="index">
					<view class="text" @tap="noticeDetails" :data-item="item">
						{{ item.name }}
					</view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 广告位 -->
		<view v-if="imgesarr.length != 0" style="padding-top: 20rpx">
			<!-- 广告位 1个 -->
			<view class="advert1" v-if="guangao == 1">
				<image class="advert1 advertisementImg" :src="activities[0].coverImg" :data-type="item.connectionType"
					:data-details="item.details" :data-link="item.link" :data-item="item" @tap="advert"
					v-for="(item, index) in activities" :key="index" :data-atype="item.activityType"
					:data-mid="item.marketingId">
				</image>
			</view>
			<!-- 廣告位 2个 -->
			<view class="advert2" v-else-if="guangao == 2">
				<image class="" :src="item.coverImg" mode="aspectFit|aspectFill|widthFix" :data-item="item"
					@tap="advert" :data-type="item.connectionType" :data-details="item.details" :data-link="item.link"
					v-for="(item, index) in activities" :key="index" :data-atype="item.activityType"
					:data-mid="item.marketingId">
				</image>
			</view>
			<!-- 广告位3个 -->
			<view class="advert3" v-else-if="guangao == 3">
				<image :class="index > 1 ? 'advertisementImg' : ''" :src="item.coverImg"
					mode="aspectFit|aspectFill|widthFix" :data-item="item" @tap="advert"
					:data-type="item.connectionType" :data-details="item.details" :data-link="item.link"
					v-for="(item, index) in activities" :key="index" :data-atype="item.activityType"
					:data-mid="item.marketingId"></image>
				<!-- <image class="{{index>1?'advertisementImg' :''}}" src="{{item}}" mode="aspectFit|aspectFill|widthFix" wx:for="{{imgesarr}}" wx:key="index" bindtap="advert" ></image> -->
			</view>
			<!-- 广告位4个 -->
			<view class="advert4" v-else-if="guangao == 4">
				<image :class="index > 2 ? 'advertisementImg' : ''" :src="item.coverImg"
					mode="aspectFit|aspectFill|widthFix" :data-item="item" @tap="advert"
					:data-type="item.connectionType" :data-details="item.details" :data-link="item.link"
					v-for="(item, index) in activities" :key="index" :data-atype="item.activityType"
					:data-mid="item.marketingId"></image>
			</view>
			<!-- 广告位5个 -->
			<view class="advert5" v-else-if="guangao == 5">
				<image :class="index > 2 ? 'hengtu' : ''" :src="item.coverImg" mode="aspectFit|aspectFill|widthFix"
					:data-item="item" @tap="advert" :data-type="item.connectionType" :data-details="item.details"
					:data-link="item.link" v-for="(item, index) in activities" :key="index"
					:data-atype="item.activityType" :data-mid="item.marketingId"></image>
			</view>
			<!-- 广告位6个 -->
			<view class="advert6" v-else-if="guangao == 6">
				<image :class="index > 2 ? '' : ''" :src="item.coverImg" mode="aspectFit|aspectFill|widthFix"
					v-if="index < 3" :data-item="item" @tap="advert" :data-type="item.connectionType"
					:data-details="item.details" :data-link="item.link" v-for="(item, index) in activities" :key="index"
					:data-atype="item.activityType" :data-mid="item.marketingId"></image>
				<image class="hengtu" :src="activities[3].coverImg" mode="aspectFit|aspectFill|widthFix"
					:data-item="activities[3]" @tap="advert" :data-type="activities[3].connectionType"
					:data-details="activities[3].details" :data-link="activities[3].link"
					:data-atype="item.activityType" :data-mid="item.marketingId"></image>
				<image class="hengtu" :src="activities[4].coverImg" mode="aspectFit|aspectFill|widthFix"
					:data-item="activities[4]" @tap="advert" :data-type="activities[4].connectionType"
					:data-details="activities[4].details" :data-link="activities[4].link"
					:data-atype="item.activityType" :data-mid="item.marketingId"></image>
				<image class="advertisementImg" :src="activities[5].coverImg" mode="aspectFit|aspectFill|widthFix"
					:data-item="activities[5]" @tap="advert" :data-type="activities[5].connectionType"
					:data-details="activities[5].details" :data-link="activities[5].link"
					:data-atype="item.activityType" :data-mid="item.marketingId"></image>
			</view>
		</view>

		<!-- 电站tabs -->
		<!-- ===== #二轮调整-START ===== -->
		<view class="tabs_wrap" v-if="['wzcj','szgx', 'xc', 'fsyt'].includes(sellerNo)">
			<view v-for="(item, index) in terminalList" :key="index" @click="terminalChange(index,item.value,item.label)"
				class="tabs_item">
				<view>
					<view :class="[terminalCurrent != index ? 'tabs_name1' : 'tabs_name']">{{
            item.label
          }}
					</view>
					<view class="tabs_active" v-if="terminalCurrent == index"></view>
				</view>
			</view>
		</view>



		<!-- 站点组件 -->
		<view v-if="terminalCurrent == 0" class="head-nav"
			:style="'top:' + headNavTop + 'px;'">

			<!-- <view class='nav'>
				<view :class="'nav-item ' + (navIndex == item.value ? 'activite' : '')" @tap="checkIndex" :data-value="item.value" v-for="item in tabMenu" :key="item.value">
					{{ item.label }}
				</view>
			</view> -->

			<view class="selectMenu nav">
				<picker mode="selector" @change="bindPickerChange" :range="selectMenuOptionsEnum" range-key="label">
					<view class="uni-input">{{ selectMenuOptionsEnum[selectMenuValue].label }}</view>
				</picker>
				<view class="sjx"></view>
			</view>


			<view class="all" @tap="goToSite">
				<image class="allSite" src="https://oos-cn.ctyunapi.cn/front-end/static/static/screening.png"></image>
				<text>筛选</text>
			</view>
		</view>

		<view v-show="terminalCurrent == 0" class="siteLabel_selection">
			<siteLabelSelection ref="siteLabelSelectionRef" @backHome="getSiteList('replace')"></siteLabelSelection>
		</view>
		<!-- ===== #二轮调整-END ===== -->

		<view>
			<!-- 站点信息 -->
			<siteListItem :itemData="siteItemData" @myevent="myevent" v-if="siteListShow"></siteListItem>
			<view class="noList" v-if="LoadingComplete">没有更多了</view>
			<view style="margin-top: -200rpx" v-if="showLocalService > 0">
				<Upgrading :text="showLocalService === 1? '定位服务未开启' : '定位服务信号弱'" text1="暂无法获取充电桩站信息" type="location"
					icon="https://oos-cn.ctyunapi.cn/front-end/static/static/localtion.png">
				</Upgrading>
			</view>
			<view style="margin-top: -200rpx" v-else-if="siteItemData.list.length == 0 && showList">
				<Upgrading text="暂无站点" text1="暂无数据！"
					icon="https://oos-cn.ctyunapi.cn/front-end/static/static/localtion.png">
				</Upgrading>
			</view>
		</view>
		<view class="unpaCon">
			<!-- 未支付订单等   && chargingOrderList.length == 0-->
			<view class="unpaid" v-if="unpaidOrderNum">
				<view class="top" @tap="goUnpaidOrder">
					<view>您有未支付订单 ({{ unpaidOrderNum }}单)</view>
					<view class="pay">
						去支付
						<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn_left.png">
						</image>
					</view>
				</view>
			</view>
			<!-- 正在充电(单台) -->
			<view class="chargeOne" v-if="chargingOrderList.length == 1">
				<view class="top" @tap="goChargingOrder1">
					<!-- #V2G功能 -->
					<view>{{ isV2GOption && chargingOrderList[0].disCharge ? '正在放电' : '正在充电' }}</view>
					<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn_left.png"></image>
				</view>
				<view class="charge" @tap="goChargingOrder1">
					<view class="chargeOneSoc">
						<view class="progress" v-if="chargingOrderList[0].terminalType !=2">
							{{ chargingOrderList[0].soc }}%
						</view>
						<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/charging2.gif">
						</image>
					</view>
					<view class="charge_info">
						<!-- #V2G功能 -->
						<view class="txt1">
							{{ isV2GOption && chargingOrderList[0].disCharge ? '已放：' : '已充：' }}{{ chargingOrderList[0].power }}度
						</view>
						<view class="txt1" v-if="chargingOrderList[0].terminalType !=2">
							剩余：{{ chargingOrderList[0].retainTime }}分</view>
					</view>

					<view class="charge_cost">
						<view class="price">
							{{ chargingOrderList[0].chargeBalance }}
							<text class="txt2">元</text>
						</view>
						<!-- #V2G功能 -->
						<view class="txt1" style="font-weight: 400">
							{{ isV2GOption && chargingOrderList[0].disCharge ? '放电收益' : '充电费用' }}
						</view>
					</view>
				</view>
			</view>
			<!-- 正在充电(多台) -->
			<view class="chargeMore" v-if="chargingOrderList.length > 1">
				<view class="top" @tap="goChargingOrder">
					<view>正在充电（{{ chargingOrderList.length }}辆）</view>
					<image class="img" src="https://oos-cn.ctyunapi.cn/front-end/static/static/turn_left.png"></image>
				</view>
				<scroll-view :scroll-y="true" style="height: 210rpx">
					<view class="chargeItem" v-for="(item, index) in chargingOrderList" :key="index">
						<view class="equipment">
							<view class="txt1">{{ item.plateno }}</view>
							<view class="txt1" v-if="item.terminalType !=2">余：{{ item.retainTime }}</view>
						</view>

						<view class="equipment">
							<view class="txt3" v-if="item.terminalType ===2"></view>
							<view class="txt3" v-else>{{ item.soc }}%</view>
							<view class="txt4">
								<!-- #V2G功能 -->
								{{ isV2GOption && item.disCharge ? '放电收益：' : '当前费用：' }}
								<text class="money">{{ item.chargeBalance }}</text>
								<text class="unit">元</text>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>

		<shadePopup :show="showCoupons2" @close="onActivityClose">
			<view class="coupons2">
				<swiper :indicator-dots="indicatorDotsCoupons2" :autoplay="autoplayCoupons2"
					:interval="intervalCoupons2" :duration="durationCoupons2" :circular="true" indicator-col="#FEA48F"
					class="coupons2-swiper" indicator-active-color="#FFFFFF">
					<!-- <view class="coupons2-swiper-item-list" > -->
					<swiper-item class="coupons2-swiper-item" :data-item="item" @tap="naviActivity($event,'shadePopup')"
						v-for="(item, index) in couponImgList" :key="index">
						<image :src="item.image" class="swiperitem"></image>
					</swiper-item>
					<!-- </view> -->
				</swiper>
			</view>
		</shadePopup>

		<shadePopup @close="onClose($event, { id: announcementId })" position="center" :data-id="announcementId"
			:show="announcementStatus1" custom-style="border-radius: 16rpx;" class="announcement-popup" closeable>
			<view class="announcement-popup">
				<view class="announcement" style="border-radius: 16rpx;">
					<view class="announcement-header">
						<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/announcement.png"
							class="announcement-header-img" mode="aspectFit"></image>
					</view>
					<view class="announcement-content">
						<view class="announcement-title">{{ announcementTitle }}</view>
						<view class="announcement-body">
							<rich-text :nodes="announcementBody"></rich-text>
						</view>
					</view>
					<view class="announcement-close" v-if="linkUrl || mobilePath" @tap="naviLink" :data-link="linkUrl"
						:data-mobilePath="mobilePath" :data-linktype1="linkType1">立即前往</view>
					<view class="announcement-close" v-else @tap="onClose" :data-id="announcementId">我知道了</view>
				</view>
			</view>
		</shadePopup>

		<!-- 筛选-->
		<uni-popup ref="showPreferencePup" background-color="#fff" safe-area type="bottom">
			<view class="pop_title">筛选</view>
			<view class="pop_top">
				<view class="content_list">
					<scroll-view scroll-y="true" class="scroll_view_style">
						<!-- 距离 -->
						<view class="type">
							<view class="type_title">{{ distanceList.name }}</view>
							<view class="type_list">
								<view
									:class="memberQueryPreferenceDto.distance == item.key ? 'type_itme_sel' : 'type_itme'"
									@tap="checkDistance" :data-key="item.key" v-for="(item, index) in distanceList.list"
									:key="index">
									{{ item.value }}
								</view>
							</view>
						</view>
						<!-- 站点类型 -->
						<view class="type">
							<view class="type_title">{{ siteTypeList.name }}</view>
							<view class="type_list">
								<view
									:class="memberQueryPreferenceDto.stationType == item.key ? 'type_itme_sel' : 'type_itme'"
									@tap="checkSiteType" :data-key="item.key" v-for="(item, index) in siteTypeList.list"
									:key="index">
									{{ item.value }}
								</view>
							</view>
						</view>
						<!-- 充电模式 -->
						<view class="type">
							<view class="type_title">{{ chargingModeList.name }}</view>
							<view class="type_list">
								<view
									:class="memberQueryPreferenceDto.fastSlow == item.key ? 'type_itme_sel' : 'type_itme'"
									@tap="checkChargingMode" :data-key="item.key"
									v-for="(item, index) in chargingModeList.list" :key="index">
									{{ item.value }}
								</view>
							</view>
						</view>
						<!-- 建设场所 -->
						<view class="type">
							<view class="type_title">{{ constructionSiteList.name }}</view>
							<view class="type_list">
								<view
									:class="memberQueryPreferenceDto.construction == item.key ? 'type_itme_sel' : 'type_itme'"
									@tap="checkConstructionSite" :data-key="item.key"
									v-for="(item, index) in constructionSiteList.list" :key="index">
									{{ item.value }}
								</view>
							</view>
						</view>
						<!-- 优惠 -->
						<!-- <view class="type">
				    <view class="type_title">{{ discountList.name }}</view>
				    <view class="type_list">
				        <view
				            :class="memberQueryPreferenceDto.discount == item.key ? 'type_itme_sel' : 'type_itme'"
				            @tap="checkIsDiscount"
				            :data-key="item.key"
				            v-for="(item, index) in discountList.list"
				            :key="index"
				        >
				            {{ item.value }}
				        </view>
				    </view>
				</view> -->
					</scroll-view>
				</view>
				<view class="type_btn">
					<view class="btn1" @tap="canalPreference">清除</view>
					<view class="btn2" @tap="enterPreference">确定</view>
				</view>
			</view>
		</uni-popup>
		<!-- 占枪弹窗 -->
		<placeholPilePopup ref='placeholPilePopup'></placeholPilePopup>



		<!-- 新人专享好礼 组件 -->
		<newUserPopup ref='newUserPopup' />

		<!-- 成功邀请专享好礼 组件 -->
		<activityPopup />

		<!-- 推广员获奖通知弹窗 组件 -->
		<probationPopup />

		<!-- 推广员是否审核弹窗=>1是2否 组件 -->
		<probationByPopup />
		<!-- 下端导航栏 -->
		<Tabbar :currentPage="0" :isNew="isNew"></Tabbar>
	</view>
</template>

<script>
	'use strict';
	import Tabbar from '@/components/tabbar/tabbar';
import siteListItem from '@/components/site-list/site-list-item';
import Upgrading from '@/components/upgrading/upgrading';
import popup from '@/components/popup/popup';
import shadePopup from '@/components/shadePopup/shadePopup';
import customNavigationBar from '@/components/customNavigationBar/customNavigationBar';
import placeholPilePopup from '@/components/placeholPilePopup/placeholPilePopup';
import newUserPopup from '@/components/newUserPopup/newUserPopup';
import activityPopup from '@/components/activityPopup/activityPopup';
import probationPopup from '@/components/probationPopup/probationPopup';
import probationByPopup from '@/components/probationByPopup/probationByPopup';
import FullscreenAd from '@/components/adModule/FullscreenAd';

	import siteLabelSelection from '@/components/siteLabelSelection/siteLabelSelection';

	import {
	indexStationNewV2,
	indexStationNewV2NoAuth,
} from '@/api/mobileUpdate';

	//付费会员列表 
	import {
	noVipDetail,
} from '@/api/marketing/vip';
import {
	getPromoterDetail
} from '../../api/marketing/promotion';
import {
	getMessageStatus
} from '../../api/marketing/messageApi';

	// #ifdef APP-PLUS
	import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update.js';
	// #endif

	var app = getApp(); // import { textareaProps } from "miniprogram/miniprogram_npm/@vant/weapp/field/props"

	var https_1 = require('./../../api/https.js');

	var util_1 = require('./../../utils/util.js');

	var times = null;

	// 默认菜单
	const DEFAULT_TERMINALLIST = [{
			label: '汽车充电桩',
			value: 1
		},
		{
			label: '两轮充电桩',
			value: 2
		},
	]
	// 私人共享桩
	const PRIVATE_TERMINALLIST = [
		{
			label: '汽车充电桩',
			value: 1,
			private: false
		},
		{
			label: '私人共享桩',
			value: 1,
			private: true
		},
	]

	export default {
		components: {
			Tabbar,
			siteListItem,
			Upgrading,
			popup,
			shadePopup,
			customNavigationBar,
			placeholPilePopup,

			newUserPopup,
			activityPopup,
			probationPopup,
			probationByPopup,

			siteLabelSelection,
			FullscreenAd
		},
		data() {
			const terminalListMap = {
				'wzcj': DEFAULT_TERMINALLIST,
				'xc': DEFAULT_TERMINALLIST,
				'szgx': PRIVATE_TERMINALLIST,
				'fsyt': PRIVATE_TERMINALLIST, // 智联慧充
			}

			console.log(app.globalData.sellerNo, '====================================');
			return {
				sellerNo: app.globalData.sellerNo,
				privateName: '',
				// ===== #二轮调整-START =====
				terminalList: terminalListMap[app.globalData.sellerNo],
				// terminalCurrent: app.globalData.sellerNo === 'xc'? 0 : 1,
				// terminalType: app.globalData.sellerNo === 'xc'? 2 : 1,
				terminalCurrent: 0,
				terminalType: 1,
				// ===== #二轮调整-END =====
				pageApiObj: false,
				isNew: false,
				getPromoterDetail: '',
				oldStatus: false,
				newStatus: false,

				indexSwitch: undefined,

				selectMenuValue: 0,
				selectMenuValueNum: 3,
				selectMenuOptionsEnum: [{
						label: '综合排序',
						value: 3,
					},
					{
						label: '距离最优',
						value: 0,
					},
					{
						label: '价格最优',
						value: 1,
					},
					{
						label: '空闲最多',
						value: 2,
					},
				],

				pilePopup: true,
				siteListShow: true,
				isIpx: false,
				lunbao: {},
				link: false,
				isShow: true,
				isWallet: true,
				isCard: true,
				isLogin: false,

				personage: {
					memberType: 0,
					accountBalance: '',
					svgChargeCost: '',
					deductMode: '',
					carAccountBalance: ''
				},

				isUnpaid: false,
				isCharge: false,
				isMoreCharge: false,
				navIndex: 2,
				current: 0,
				guangao: 1,
				imgesarr: [],
				// tabMenu: ['精选', '附近', '特惠', '去过'],
				tabMenu1: [{
					label: '全部站场',
					value: 2
				}, {
					label: '精选站点',
					value: 1
				}, {
					label: '价格特惠',
					value: 3
				}],
				tabMenu: [],

				dotsStyles: {
					backgroundColor: 'rgba(255, 255, 255,0.3)',
					border: '1px rgba(255, 255, 255,0.3) solid',
					color: '#ffffff',
					width: '4',
					bottom: '10',
					selectedBackgroundColor: 'rgba(255, 255, 255,0.9)',
					selectedBorder: '1px rgba(255, 255, 255,0.9) solid'
				},

				swiperDotIndex: 0,

				// 是否显示面板指示点
				indicatorDots: true,

				// 滑动方向是否为纵向
				vertical: false,

				// 自动切换
				autoplay: true,

				// 采用衔接滑动
				circular: true,

				// 自动切换时间间隔2s
				interval: 3000,

				// 滑动动画时长0.5s
				duration: 500,

				message: false,
				noticeList: [],

				//站点组件
				siteItemData: {
					list: []
				},

				loading: true,
				chargeList: [],
				announcementIndex: 0,
				announcementStatus1: false,
				announcementStatus2: false,
				showCoupons: false,
				announcementTitle: '',
				announcementBody: '',
				linkUrl: '',
				mobilePath: '',
				linkType1: '',
				announcementId: '',

				couponsList: [{
						vouchersName: '现金券',
						vouchersAmount: '10',
						expiryDate: '05-20过期',
						fullReduction: '满200元可用',
						siteCertificate: '站点所属券'
					},
					{
						vouchersName: '现金券',
						vouchersAmount: '10',
						expiryDate: '05-20过期',
						fullReduction: '满200元可用',
						siteCertificate: '站点所属券'
					},
					{
						vouchersName: '现金券',
						vouchersAmount: '10',
						expiryDate: '05-20过期',
						fullReduction: '满200元可用',
						siteCertificate: '站点所属券'
					}
				],

				showCoupons2: false,
				indicatorDotsCoupons2: true,
				verticalCoupons2: false,
				autoplayCoupons2: true,
				intervalCoupons2: 5000,
				durationCoupons2: 500,
				couponImgList: [],
				announcementlinkUrl: '',
				activities: '',
				readStatus: false,
				unpaidOrderNum: 0,
				infos: [],
				advertisingInfo: {},
				chargingOrderList: '',
				userInfo: '',
				memberId: '',
				bar_Height: uni.getSystemInfoSync().statusBarHeight,
				widnowH: uni.getSystemInfoSync().screenHeight,
				coverImg: '',
				connectionType: '',
				details: '',
				gunMonitorDto: {
					soc: '',
					power: 0,
					remainTime: ''
				},

				distanceList: {
					name: '距离',
					list: [{
							value: '不限',
							key: null
						},
						{
							value: '1KM',
							key: 1
						},
						{
							value: '3KM',
							key: 3
						},
						{
							value: '5KM',
							key: 5
						},
						{
							value: '10KM',
							key: 10
						},
						{
							value: '20KM',
							key: 20
						},
						{
							value: '50KM',
							key: 50
						},
						{
							value: '100KM',
							key: 100
						}
					]
				},

				siteTypeList: {
					name: '站点类型',
					list: [{
							value: '不限',
							key: null
						},
						{
							value: '公共',
							key: 1
						},
						{
							value: '个人',
							key: 2
						},
						{
							value: '公交',
							key: 3
						},
						{
							value: '环卫',
							key: 4
						},
						{
							value: '物流',
							key: 5
						},
						{
							value: '出租车',
							key: 6
						},
						{
							value: '其他',
							key: 7
						}
					]
				},

				chargingModeList: {
					name: '充电模式',
					list: [{
							value: '不限',
							key: null
						},
						{
							value: '超充',
							key: 'overTake'
						},
						{
							value: '快充',
							key: 'kuai'
						},
						{
							value: '慢充',
							key: 'man'
						}
					]
				},

				constructionSiteList: {
					name: '建设场所',
					list: [{
							value: '不限',
							key: null
						},
						{
							value: '居民区',
							key: 1
						},
						{
							value: '公共机构',
							key: 2
						},
						{
							value: '企事业单位',
							key: 3
						},
						{
							value: '写字楼',
							key: 4
						},
						{
							value: '工业园区',
							key: 5
						},
						{
							value: '交通枢纽',
							key: 6
						},
						{
							value: '大型文体设施',
							key: 7
						},
						{
							value: '城市绿地',
							key: 8
						},
						{
							value: '大型建筑配件停车场',
							key: 9
						},
						{
							value: '路边停车位',
							key: 10
						},
						{
							value: '城际高速服务区',
							key: 11
						},
						{
							value: '其他',
							key: 12
						}
					]
				},

				discountList: {
					name: '优惠',
					list: [{
							value: '不限',
							key: 2
						},
						{
							value: '有优惠',
							key: 3
						},
						{
							value: '无优惠',
							key: 5
						}
					]
				},

				// 筛选条件
				memberQueryPreferenceDto: {
					distance: null,
					fastSlow: null,
					stationType: null,
					construction: null,
					discount: null
				},
				areaIdList: [],
				areaId: 0,
				cityname: '',
				showLocalService: 0,

				page: 1,
				pages: 2,
				LoadingComplete: false,
				configHomeIcon: {},
				appName: '绿配充电',
				nameShow: false,
				showList: false,

				searchBoxHeight: 0,
				searchTagTop: 0,
				headNavTop:0,
			};
		},
		mounted() {
			// // #ifdef H5
			// alert('mounted')
			// alert(window.qrcodeSuccess)
			//  if(window.qrcodeSuccess){
			// 	window.qrcodeSuccess((data)=>{
			// 		alert('扫码内容')
			// 		alert(data)
			// 		scanCodeFn(decodeURIComponent(data))
			// 	})
			//  }
			// // #endif
			console.log(11111111111111, uni.getStorageSync('defaultColor_Green'))
		},
		async onLoad(options) {
			console.log("打印数据1q", options, options.q)
			this.setPageStyle()

			var that = this;
			uni.getSystemInfo({
				success: function(res) {
					if (res.statusBarHeight > 20) {
						that.isIpx = true
					}
				}
			});

			if (uni.getStorageSync('token')) {
				this.isLogin = true
				this.getAdvertisingPopups();
			} else {
				this.isLogin = false

				// this.getSiteList('replace')
			}
			// #ifdef MP-ALIPAY
			setTimeout(() => {
				const url_aplpay = uni.getStorageSync('openQrcodeUrl')
				console.log('监听到事件来自 openQrcodeUrl ，携带参数 msg 为：', url_aplpay);
				if (url_aplpay) {
					that.goTerminalDetails(url_aplpay)
					return
				}
			})
			// #endif


			// #ifndef MP-ALIPAY
			var url = decodeURIComponent(options.q);
			if (url.indexOf("?") != -1) {
				this.goTerminalDetails(url)
			}
			// #endif

		},
		// 生命周期函数--监听页面显示
		async onShow() {
			uni.hideTabBar({});
			https_1.getNew().then((res) => {
				if (res.code == 0) {
					this.isNew = res.data
				}
			})
			this.isLogin = !!uni.getStorageSync('token')

			//首页定栏城市显示 
			if (uni.getStorageSync('cityName')) {
				this.cityname = uni.getStorageSync('cityName')
			} else {
				//#ifdef APP-PLUS
				this.cityname = uni.getStorageSync('cityName') || uni.getStorageSync('currentCityName') || app
					.globalData.defaultCity.cityName
				//#endif

				//#ifdef MP-WEIXIN || MP-ALIPAY
				this.cityname = uni.getStorageSync('currentCityName')
				//#endif
			}

			if (uni.getStorageSync('switchChecked')) {
				this.tabMenu = this.tabMenu1.filter(item => item.value != 1)
			} else {
				this.tabMenu = this.tabMenu1
			}


			let getMemberQueryPreferenceDto = uni.getStorageSync('siteFiltering')
			console.log('getMemberQueryPreferenceDto===>index', getMemberQueryPreferenceDto)
			setTimeout(() => {
				this.$refs.siteLabelSelectionRef && this.$refs.siteLabelSelectionRef.getIndexSearchCondition()
			}, 300)
			// this.$refs.siteLabelSelectionRef.getIndexSearchCondition()



			var that = this;
			const icon_res = await this.getIconMap();
			this.getConfig()
			this.setData({
				nameShow: true
			})
			if (icon_res.code === 0) {
				that.configHomeIcon = icon_res.data.HOME_PAGE_THEME_MODULE;
			}
			Promise.all([this.infosFun(), this.getActivitys(), this.getStyleConfig()])
			// this.nameShow = true
			if (uni.getStorageSync('token')) {
				// this.isLogin = true
				this.getMemberInfo(() => {
					if (this.marketingSwitch) {
						console.log('营销获客正常,走外包8081逻辑');
						this.getIsReadYx();
					} else {
						console.log('营销获客挂了,走7100逻辑');
						this.getIsRead();
					}
				});
				this.queryNewMessage();

				// this.getSiteList('replace')

				this.chargeInfos();
				this.getMyNotPayBillNumber();
				times = setInterval(function() {
					that.chargeInfos();
				}, 5000);
				this.$refs.placeholPilePopup.show_on()
			} else {
				// this.isLogin = false 
				//公告未登录接口
				this.queryNewMessageNotAuth()
			}

			this.getSiteList('replace')
			this.$refs.newUserPopup.showFn()
			this.$nextTick(() => {
				this.$refs.customerRef.getConfig_tow()
			})
		},
		async onPullDownRefresh() {
			this.siteListShow = false;
			const icon_res = await this.getIconMap();
			if (icon_res.code === 0) {
				this.configHomeIcon = icon_res.data.HOME_PAGE_THEME_MODULE;
			}

			this.setData({
				page: 1,
				pages: 1,
				'siteItemData.list': []
			});
			this.getSiteList('replace')
			this.siteListShow = true

			// this.getMemberInfo();
			// this.queryNewMessage();
			// this.getIsRead();
			// this.getMyNotPayBillNumber();
			// this.siteListShow = true;
			// setTimeout(function () {
			// 	uni.stopPullDownRefresh();
			// }, 1500);


			if (uni.getStorageSync('token')) {
				// this.getSiteList('replace')
				this.getMemberInfo();
				this.queryNewMessage();
				this.getIsRead();
				this.getMyNotPayBillNumber();
				// this.siteListShow = true;
			} else {
				this.queryNewMessageNotAuth()

				// this.getSiteList('replace')
			}

			// this.getSiteList('replace')

			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1500);
		},
		onHide: function() {
			console.log('onHide');
			this.setData({
				page: 1,
				// nameShow: false
			});
			clearInterval(times);
		},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {
			clearInterval(times);
			uni.removeStorageSync('openQrcodeUrl');
		},
		onReady() {
			// #ifdef APP-PLUS
			if (!app.globalData.isOpenDev) {
				// 生产环境才进行检测APP更新
				checkUpdate() // APP升级中心-检查更新
			}
			// #endif
		},
		methods: {
			// 样式兼容处理
			setPageStyle() {
				if (this.widnowH <= 568) {
					this.searchBoxHeight = this.bar_Height + 105
					this.searchTagTop = this.bar_Height + 40
					this.headNavTop = this.bar_Height + 105

					// #ifdef MP-ALIPAY
					this.searchBoxHeight = 115
					this.searchTagTop = 65
					this.headNavTop = 115
					// #endif
				} else {
					this.searchBoxHeight = this.bar_Height + 110
					this.searchTagTop = this.bar_Height + 45
					this.headNavTop = this.bar_Height + 110

					// #ifdef MP-ALIPAY
					this.searchBoxHeight = 120
					this.searchTagTop = 70
					this.headNavTop = 120
					// #endif
				}
			},

			terminalChange(index, terminalType,name) {
				console.log('name', name)
				this.terminalCurrent = index;
				this.terminalType = terminalType
				this.privateName = name
				this.station('replace');
				
			},
			bindPickerChange: function(e) {
				// '综合排序',3
				// 	'距离最优',0
				// 	'价格最优',1
				// 	'空闲最多',2
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.selectMenuValue = e.detail.value

				if (this.selectMenuValue == 0) {
					this.selectMenuValueNum = 3
				} else if (this.selectMenuValue == 1) {
					this.selectMenuValueNum = 0
				} else if (this.selectMenuValue == 2) {
					this.selectMenuValueNum = 1
				} else if (this.selectMenuValue == 3) {
					this.selectMenuValueNum = 2
				}

				this.station('replace');
			},

			// 直接跳转到终端详情页面
			goTerminalDetails(url) {
				var theRequest = {
					pileNo: '',
					gunNo: ''
				};
				var str = url.split("?")[1];
				let strs = str.split("&");
				for (var i = 0; i < strs.length; i++) {
					theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
				}
				let reg = new RegExp(/(\w+):\/\/([^/:]+)(:\d*)?/)
				let platformNo = ''
				try {
					console.log("获取域名成功", url.match(reg))
					platformNo = url.match(reg)[2];
					if (url.match(reg)[3]) {
						platformNo = platformNo + url.match(reg)[3]
					}
					theRequest.platformNo = platformNo
				} catch (error) {
					console.log('获取域名失败')
				}
				console.log('theRequest', theRequest)

				// 计费策略二轮处理
				if (theRequest.pileNo.indexOf('@2') > -1) {
					theRequest.pileNo = theRequest.pileNo.split('@')[0]
					this.wxScanCodeLogin(
						`/homeSub/pages/eBikeSiteDetail/eBikeSiteDetail?pileNo=${theRequest.pileNo}&gunNo=${theRequest.gunNo}`
					)
					return
				}


				if (theRequest.gunNo == `-1`) {
					this.wxScanCodeLogin(
						`/echartsPages/pages/terminal/pileDetail/pileDetail?pileNo=${theRequest.pileNo}&platformNo=${theRequest.platformNo}`
					)
					// app.globalData.CHECK_LOGIN(function() {
					//   uni.navigateTo({
					//     url: '../../echartsPages/pages/terminal/pileDetail/pileDetail?pileNo=' + theRequest.pileNo 
					//   })
					// })
					return false
				}
				if (theRequest.pileNo && theRequest.gunNo) {
					this.wxScanCodeLogin(
						`/homeSub/pages/terminal/gunDetail/gunDetail?pileNo=${theRequest.pileNo}&gunNo=${theRequest.gunNo}&platformNo=${theRequest.platformNo}`
					)
					// app.globalData.CHECK_LOGIN(function() {
					// uni.navigateTo({
					//   url: '../../homeSub/pages/terminal/gunDetail/gunDetail?pileNo=' + theRequest.pileNo + '&gunNo=' + theRequest.gunNo
					// })
					// })
				}
				// 扫一扫 招小服的定制功能
				if(theRequest.connectorID){
					this.wxScanCodeLogin(
						`/homeSub/pages/terminal/gunDetail/gunDetail?connectorID=${theRequest.connectorID}&platformNo=${theRequest.platformNo}`
					)
				}
			},
			wxScanCodeLogin(url) {
				if (uni.getStorageSync('token')) {
					uni.navigateTo({
						url
					})
				} else {
					uni.navigateTo({
						url: `/packagePersonal/pages/login/login?qrCodeUrl=${encodeURIComponent(url)}`
					})
				}
			},
			// 获取平台配置
			getConfig() {
				https_1
					.getSellerBasicsConfig({
						sellerId: getApp().globalData.sellerId
					})
					.then(res => {
						console.log(res, '数据')
						if (res.code == 0) {
							uni.setStorageSync('mobilePlatformName', res.data.mobilePlatformName)
						}

					})
			},
			// 获取后台配置图标
			getIconMap() {
				return https_1.getIconMap({
					sellerId: app.globalData.sellerId,
					twoEnums: 'HOME_PAGE_THEME_MODULE'
				})
			},
			//获取未结算订单数
			getMyNotPayBillNumber: function() {
				var that = this;
				https_1.getMyNotPayBillNumber({
					prePayVer: 1
				}).then(function(res) {
					if (res.code == 0) {
						that.unpaidOrderNum = res.data
					}
				});
			},

			//查询正在充电订单
			chargeInfos: function() {
				if (!uni.getStorageSync('token')) {
					clearTimeout(times);
					return
				}

				var that = this;
				https_1.pageChargeServiceMonitorNew({
					current: 1,
					pageSize: 100,
					memberNo: uni.getStorageSync('tel')
				}).then(function(res) {
					if (res.code == 0) {
						that.chargingOrderList = res.data.data

						if (!res.data.data) {
							clearTimeout(times);
						}

						if (res.data.data.length < 1) {
							that.getMyNotPayBillNumber();
							clearTimeout(times);
						}
					} else {
						clearTimeout(times);
					}
				});
			},

			//未支付订单
			goUnpaidOrder: function() {
				uni.navigateTo({
					url: '../../orderSub/pages/order/order?orderTypeIndex=3'
				});
			},

			//充电中订单（单台）
			goChargingOrder1: function() {
				console.log(this.chargingOrderList)
				if (this.isV2GOption && this.chargingOrderList[0].disCharge) {
					// 放电页面-#V2G功能
					uni.navigateTo({
						url: '/echartsPages/pages/dischargePower/dischargePower?busId=' +
							this.chargingOrderList[0].billNo +
							'&pileNo=' +
							this.chargingOrderList[0].pileNo +
							'&gunNo=' +
							this.chargingOrderList[0].gunNo + '&stationId=' + this.chargingOrderList[0]
							.stationId
					});
				} else {
					uni.navigateTo({
						url: '/echartsPages/pages/power/power?busId=' +
							this.chargingOrderList[0].billNo +
							'&pileNo=' +
							this.chargingOrderList[0].pileNo +
							'&gunNo=' +
							this.chargingOrderList[0].gunNo + '&stationId=' + this.chargingOrderList[0]
							.stationId
					});
				}
			},

			//充电中订单（多台）
			goChargingOrder: function() {
				uni.navigateTo({
					url: '../../orderSub/pages/order/order?orderTypeIndex=1'
				});
			},

			//获取用户信息
			getMemberInfo: function(cb) {
				var that = this;
				https_1.getMemberInfo().then(function(res) {
					if (res.code == 0) {
						var data = res.data;

						if (data.accountBalance) {
							data.accountBalance = (data.accountBalance / 100).toFixed(2);
						} else {
							data.accountBalance = '0.00';
						}

						if (data.carAccountBalance) {
							data.carAccountBalance = (data.carAccountBalance / 100).toFixed(2);
						} else {
							data.carAccountBalance = '0.00';
						}
						uni.setStorageSync('memberId', data.memberId)
						// data.tokenMemberType：个人0车队2
						uni.setStorageSync('memberType', data.tokenMemberType)
						// if (uni.getStorageSync('memberType').toString()){
						// 	data.memberType = uni.getStorageSync('memberType')
						// }else {
						// 	uni.setStorageSync('memberType',data.memberType)
						// }

						that.personage = data
						that.getAccountInfo(data.tokenMemberType)

						//页面加载最慢的请求结束后再显示
						that.pageApiObj = true

						cb && cb()
					}
				});
			},

			//去登录
			goLogin: function() {
				uni.navigateTo({
					url: '/packagePersonal/pages/login/login'
				});
			},

			//个人账号
			goPersonalAccount: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/individualAccount/individualAccount?tab=1'
					});
				});
			},

			//车队账号
			goPersonalAccount1: function() {
				let that = this
				app.globalData.CHECK_LOGIN(function() {
					if (that.accountInfo.deductMode == 'TeamAccount') {
						return uni.showToast({
							title: '暂无权限查看',
							icon: 'none',
							duration: 2000
						})
					}
					uni.navigateTo({
						url: '../../mine/pages/personalAccount/personalAccount?tab=2'
					});
				});
			},
			//去充值
			goPersonalAccount2: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/recharge/recharge'
					});
				});
			},

			//轮播图
			infosFun: function() {
				const that = this;
				let cityName = uni.getStorageSync('cityName') || uni.getStorageSync('currentCityName') || '全国';
				https_1
					.info({
						sellerNo: app.globalData.sellerNo,
						address: cityName
					})
					.then(function(res) {
						if (res.code == 0) {
							var swiperItem_1 = res.data.indexAdvertising;

							if (swiperItem_1.length > 0) {
								swiperItem_1.forEach(function(element) {
									if (/^http/.test(element.image)) {
										that.lunbao = swiperItem_1
									}
								});
							}

							that.lunbao = swiperItem_1
							console.log(that.lunbao, 'that.lunbao')
						}
					});
			},

			// 轮播跳转详情
			advertisingLink: function(e) {
				// app.globalData.CHECK_LOGIN(function() {
				var types = e.currentTarget.dataset.type //1跳转 2是详情
				var link = e.currentTarget.dataset.link
				var path = e.currentTarget.dataset.path
				var details = e.currentTarget.dataset.details
				var title = e.currentTarget.dataset.title
				var timeS = e.currentTarget.dataset.time
				var status = e.currentTarget.dataset.status

				const activityType = e.currentTarget.dataset.atype;
				const marketingId = e.currentTarget.dataset.mid;


				var id = e.currentTarget.dataset.id
				console.log(e)
				if (types == 1) {
					app.globalData.CHECK_LOGIN(() => {
						util_1.LinkType(link);
					})
				} else if (types == 2) {
					// app.globalData.richText = details;
					// uni.navigateTo({
					// 	url: `../../homeSub/pages/advertisDetails/advertisDetails?title=` + title + '&time=' + timeS + '&status=' + status
					// });
					//为解决跳转后分享问题使用新的页面方法;
					uni.navigateTo({
						url: `../../homeSub/pages/advertisDetails/advertisDetailsNew?id=${id}`
					});
				} else if (types == 4) {
					console.log('2222', this, activityType, marketingId)
					// 处理营销获客逻辑
					this.disposeMarketingActivity(activityType, marketingId);
				} else if (types == 5) {
					app.globalData.CHECK_LOGIN(() => {
						uni.navigateTo({
							url: path
						});
					})
				} else {
					app.globalData.CHECK_LOGIN(() => {
						return false;
					})
				}
				// })
			},
			// 处理营销活动
			disposeMarketingActivity(activityType, marketingId) {
				console.log(activityType, marketingId);
				switch (activityType) {
					// activityType:  1 => 充值奖励活动, 2 => 累计活动, 3 => 单笔折扣活动, 4 => 站点优惠活动,
					// 5 => 邀请奖励, 6 => 新客有礼, 7=> 多人拼团 8=>付费会员 9=>推广员 10=>首充有礼
					// marketingId: 活动id
					case 1:
						uni.navigateTo({
							url: '/marketing_page/pages/pay/payAward/payAward?HD=' + marketingId
						});
						break;
					case 2:
						//累计活动  -分类型判断跳不同逻辑
						uni.navigateTo({
							url: '/homeSub/pages/discount/cumulativeMoney/cumulativeMoney?HD=' + marketingId
						});
						break;
					case 3:
						uni.navigateTo({
							url: '/homeSub/pages/discount/singleMoney/singleMoney?HD=' + marketingId
						});
						break;
					case 4:
						uni.navigateTo({
							url: '/homeSub/pages/discount/siteOffers/siteOffers?HD=' + marketingId
						});
						break;
					case 5:
						// uni.navigateTo({
						// 	url: '/marketing_page/pages/invite/invitation/invitation?HD=' + marketingId
						// });
						app.globalData.CHECK_LOGIN(() => {
							uni.navigateTo({
								url: '/marketing_page/pages/invite/invitation/invitation?HD=' + marketingId
							});
						})
						break;
					case 6:
						console.log('弹出新客有礼弹窗;;;;');
						// uni.navigateTo({
						// 	url: '/main/pages/couponCenter/index?id='+ marketingId
						// });
						break;
					case 7:
						uni.navigateTo({
							url: '/marketing_page/pages/group/list/index'
						});
						break;
					case 8:
						// uni.navigateTo({
						// 	url: '/marketing_page/pages/member/index/index'
						// });
						app.globalData.CHECK_LOGIN(() => {
							// 会员列表
							noVipDetail().then(res => {
								console.log(res, 'ffhy.List.....')
								if (res.code == 200) {
									let vipId = res.data[0].vipId
									uni.navigateTo({
										url: "/mine/pages/vip/noVip?id=" + vipId,
									})
								}
							})
						})
						break;
					case 9:
						let url = this.getPromoterDetailFun?.spreadStatus == 1 ?
							'/marketing_page/pages/promotion/index/index' :
							'/marketing_page/pages/promotion/recruit_plan/recruit_plan';
						uni.navigateTo({
							url
						});
						break;
					case 10:
						uni.navigateTo({
							url: '/additional/firstTopUp/index?HD=' + marketingId
						})
						break;
				}
			},
			// 获取用户（付费会员，成长会员）信息
			getPromoterDetailFun() {
				getPromoterDetail({
					plUserId: uni.getStorageSync('memberId')
				}).then((res) => {
					console.log(res.data, '获取外包会员信息...........');
					let getPromoterDetail = res.data || {};
					this.setData({
						getPromoterDetail
					});
				});
			},
			myevent: function(e) {
				var data = e.detail;
				this.siteItemData = data;
			},
			//去选择区域
			goArea: function() {
				// app.globalData.CHECK_LOGIN(function() {
				uni.navigateTo({
					url: '/homeSub/pages/area/area'
				});
				// });
			},

			//去搜索
			goSearch: function() {
				console.log('--goSearch--');
				
				// app.globalData.CHECK_LOGIN(function() {
				uni.navigateTo({
					url: '../../homeSub/pages/search/search'
				});
				// });
			},
			goNotice: function() {
				if (this.marketingSwitch) {
					console.log('营销获客正常,走外包8081逻辑');
					uni.navigateTo({
						url: '../../homeSub/pages/messageCenterYxhk/messageCenterYxhk'
					});
				} else {
					console.log('营销获客挂了,走7100逻辑');
					uni.navigateTo({
						url: '../../homeSub/pages/messageCenter/messageCenter'
					});
				}
			},

			change: function(e) {
				this.current = e.detail.current
			},

			clickItem: function(e) {
				this.swiperDotIndex = e
			},

			//tab栏
			checkIndex: function(e) {
				var value = e.currentTarget.dataset.value;
				this.navIndex = value
				this.siteItemData.list = []
				this.showList = false
				this.page = 1
				this.getSiteList('replace')
			},

			//查看全部站点
			goToSite: function() {
				uni.navigateTo({
					url: '/pages/siteFiltering/siteFiltering'
				});
			},

			//广告配图
			getActivitys: function() {
				var that = this;
				https_1.getActivity({
					sellerNo: app.globalData.sellerNo
				}).then(function(res) {
					if (res.code == 0) {
						var activities = res.data.activities;
						var arr_1 = [];
						activities.forEach(function(element, index) {
							if (element.coverImg == null) {
								switch (res.data.activityCount) {
									case 2:
										element.coverImg =
											'https://oos-cn.ctyunapi.cn/front-end/static/static/01.png';
										break;

									case 3:
										if (index > 1) {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/01.png';
										} else {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/advertisement.png';
										}

										break;

									case 4:
										if (index > 2) {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/advertisement.png';
										} else {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/11.png';
										}

										break;

									case 5:
										if (index > 2) {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/01.png';
										} else {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/11.png';
										}

										break;

									case 6:
										if (index == 5) {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/advertisement.png';
										} else if (index > 2) {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/01.png';
										} else {
											element.coverImg =
												'https://oos-cn.ctyunapi.cn/front-end/static/static/11.png';
										}

										break;

									default:
										element.coverImg =
											'https://oos-cn.ctyunapi.cn/front-end/static/static/advertisement.png';
										break;
								}
							}

							arr_1.push(element.coverImg);
						});
						that.activities = activities,
							that.guangao = res.data.activityCount,
							that.imgesarr = arr_1
					}
				});
			},

			//广告配图跳转
			advert: function(e) {
				var that = this;
				// app.globalData.CHECK_LOGIN(function() {
				var active = [that.activities];
				var types = e.currentTarget.dataset.type; // 1是详情   2跳转

				var link = e.currentTarget.dataset.link;
				var details = e.currentTarget.dataset.details;
				var item = e.currentTarget.dataset.item

				const activityType = e.currentTarget.dataset.atype;
				const marketingId = e.currentTarget.dataset.mid;
				if (active) {
					active.forEach(function(element) {
						switch (types) {
							case 1:
								app.globalData.richText = details;
								uni.navigateTo({
									url: `../../homeSub/pages/advertisDetails/advertisDetails?title=` +
										item.title + '&time=' + item.timeS + '&status=' + item.status
								});
								// //为解决跳转后分享问题使用新的页面方法;
								// uni.navigateTo({
								// 	url: `../../homeSub/pages/advertisDetails/advertisDetailsNew?id=${item.id}`
								// });
								break;

							case 2:
								app.globalData.CHECK_LOGIN(() => {
									// #ifdef APP-PLUS || H5
									plus.runtime.openURL(link + '&time=' + item.timeS + '&status=' +
										item.status + '&title=' + item.title);
									// #endif

									// #ifdef MP-WEIXIN || MP-ALIPAY
									util_1.LinkType(link);
									// #endif
								})
								break;
							case 4:
								// 处理营销获客逻辑
								that.disposeMarketingActivity(activityType, marketingId);
							case 5:
								app.globalData.CHECK_LOGIN(() => {
									// #ifdef MP-WEIXIN || MP-ALIPAY
									util_1.LinkType(item.mobilePath);
									// #endif
								})
								break;
							default:
								app.globalData.CHECK_LOGIN(() => {
									return false;
								})
								break;
						}
					});
				}
				//  })
			},

			//公告
			queryNewMessage: function() {
				var that = this;
				https_1.queryNewMessage({}).then(function(res) {
					if (res.code == 0) {
						if (res.data != null && res.data.length != 0) {
							that.message = true,
								that.noticeList = res.data
						} else {
							that.message = false
						}
					} else {
						that.message = false
					}
				});
			},
			// 未登录 换公告接口
			queryNewMessageNotAuth: function() {
				var that = this;
				https_1.queryNewMessageNotAuth({
					sellerId: app.globalData.sellerId
				}).then(function(res) {
					if (res.code == 0) {
						if (res.data != null && res.data.length != 0) {
							that.message = true
							that.noticeList = res.data
						} else {
							that.message = false
						}
					} else {
						that.message = false
					}
					console.log(res, '公告未登录------')
				});
			},

			//公告详情
			noticeDetails: function(e) {
				const item = e.currentTarget.dataset.item;
				// 营销获客加入后产品确认跳转相对应的落地页
				if (item.linkType == 4) {
					console.log('去营销获客滚动的文字跳转', item.linkType, item);
					// 处理营销获客逻辑
					this.disposeMarketingActivity(item.activityType, item.marketingId);
				} else {
					let id = item.id;
					console.log(id, 'linkType类型' + item.linkType, item);
					if (id) {
						uni.navigateTo({
							url: '/homeSub/pages/platformAnnouncement/platformAnnouncement?id=' + id
						});
					}
				}
			},

			//获取商家样式配置
			getStyleConfig: function() {
				var that = this;
				https_1.getStyleConfig(app.globalData.sellerId).then(function(res) {
					console.log(res, '获取商家样式配置..qqqbbbbpppzzz')
					if (res.code == 0) {
						//styleOption=1是 左侧:钱包，右侧：订单，收藏
						//styleOption=2是 左侧:钱包，右侧：订单，卡券
						//styleOption=3是 左侧:订单，右侧：收藏，卡券
						if (res.data) {
							var styleOption = res.data.styleOption;

							switch (styleOption) {
								case 1:
									that.isWallet = true,
										that.isCard = false
									break;

								case 2:
									that.isWallet = true,
										that.isCard = true
									break;

								default:
									that.isWallet = false,
										that.isCard = true
									break;
							}

							//是否显示开关
							that.indexSwitch = res.data.indexSwitch
						}
					}
				});
			},

			//我的訂單
			goOrder: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../orderSub/pages/order/order'
					});
				});
			},

			//我的卡券
			naviCard: function() {
				app.globalData.CHECK_LOGIN(() => {
					if (this.marketingSwitch) {
						console.log('营销获客正常,走外包8081逻辑');
						uni.navigateTo({
							url: '../../mine/pages/cardVoucherYx/cardVoucherYx'
						});
					} else {
						console.log('营销获客挂了,走7100逻辑');
						uni.navigateTo({
							url: '../../mine/pages/cardVoucher/cardVoucher'
						});
					}
				});
			},

			//我的收藏
			goCollectionList: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../mine/pages/collectionList/collectionList'
					});
				});
			},
			// 获取站点列表
			getSiteList(type) {
				const that = this;

				let cityName = uni.getStorageSync('cityName') || uni.getStorageSync('currentCityName');
				if (cityName) {
					//#ifdef APP-PLUS
					that.station(type);
					//#endif

					//#ifdef MP-WEIXIN || MP-ALIPAY
					app.globalData.getCityId(function() {
						that.station(type);
					});
					//#endif

					//#ifdef H5
					app.globalData.getCityId(function() {
						that.station(type);
					});
					//#endif
				} else {

					//#ifdef APP-PLUS
					that.station(type);
					//#endif

					//#ifdef MP-WEIXIN || MP-ALIPAY
					app.globalData.getCity(function() {
						that.station(type);
					});
					//#endif

					//#ifdef H5
					app.globalData.getCity(function() {
						that.station(type);
					});
					//#endif

				}

			},

			// 站点列表方法
			station: function(type) {
				// if (type === 'replace') {
				// 	this.page = 1
				// 	this.siteItemData.list = []
				// }
				console.log(type, 'typeeee')
				uni.showLoading({
					title: '加载中'
				});
				var that = this;
				//#ifdef APP-PLUS
				let cityId = uni.getStorageSync('cityId') || app.globalData.defaultCity.cityId;
				//#endif
				//#ifdef MP-WEIXIN || H5 || MP-ALIPAY
				let cityId = uni.getStorageSync('cityId') || app.globalData.defaultCity.cityId;
				//#endif

				let latitude = uni.getStorageSync('latitude') || app.globalData.defaultCity.latitude;
				let longitude = uni.getStorageSync('longitude') || app.globalData.defaultCity.longitude;
				if (app.globalData.userLocalStatus === 0 || cityId && latitude && longitude) {
					this.showLocalService = 0;
					//#ifdef APP-PLUS
					that.cityname = uni.getStorageSync('cityName') || uni.getStorageSync('currentCityName') || app
						.globalData.defaultCity.cityName
					//#endif
					//#ifdef MP-WEIXIN || H5 || MP-ALIPAY
					that.cityname = uni.getStorageSync('cityName') || uni.getStorageSync('currentCityName') || app
						.globalData.defaultCity.cityName
					//#endif

					// https_1.indexStationNew({
					// 	areaId: cityId,
					// 	areaName: that.cityname,
					// 	latitude: latitude,
					// 	longitude: longitude,
					// 	sellerNo: app.globalData.sellerNo,
					// 	type: this.navIndex,
					// 	memberQueryPreferenceDto: this.memberQueryPreferenceDto,
					// 	current: this.page,
					// 	pageSize: 10
					// })

					// 获取站点列表v2
					let siteFiltering = uni.getStorageSync('siteFiltering');
					let siteLabelSelection = uni.getStorageSync('siteLabelSelection');
					let tagFilter = {
						...siteFiltering,
						...siteLabelSelection
					}

					if (siteFiltering.gunType && siteLabelSelection.gunType) {
						tagFilter.gunType = [...siteFiltering.gunType, ...siteLabelSelection.gunType]
					}
					if (siteFiltering.serviceFacilities && siteLabelSelection.serviceFacilities) {
						tagFilter.serviceFacilities = [...siteFiltering.serviceFacilities, ...siteLabelSelection
							.serviceFacilities
						]
					}

					console.log(tagFilter, 'index==>>tagFilter.....', this.terminalType)

					let datas = {
						terminalType: this.terminalType, // 1-四轮，2-二轮
						"sellerId": getApp().globalData.sellerId,
						"areaId": cityId,
						"latitude": latitude,
						"longitude": longitude,
						"current": this.page,
						"pageSize": 10,
						"sortMode": this.selectMenuValueNum,
						"isCollect": false,
						...tagFilter,
					}

					if (this.sellerNo == 'szgx') {
						datas.privatePile = this.privateName =='私人共享桩'
					}

					console.log(datas, 'index站点筛选条件.....');

					let getApiUrl = uni.getStorageSync('token') ? indexStationNewV2 : indexStationNewV2NoAuth
					getApiUrl({
							...datas
						})
						.then(function(res) {
							console.log(res, '站点==>stationData*********');
							uni.hideLoading()
							if (res.code == 0) {
								that.setData({
									page: res.data.pageNo,
									pages: res.data.pages
								});
								if (res.data.pageNo == res.data.pages) {
									that.setData({
										LoadingComplete: true
									});
								} else {
									that.setData({
										LoadingComplete: false
									});
								}

								var list = res.data.data || []; // 没有数据不操作

								if (list.length == 0 && res.data.pageNo == 1) {
									that.setData({
										'siteItemData.list': [],
										showList: true
									});
									return false;
								}

								if (type === 'replace') {
									that.setData({
										'siteItemData.list': list,
										'siteItemData.timestamp': Date.now(), // #V2G功能
										showList: true
									});
								} else {
									that.setData({
										'siteItemData.list': that.siteItemData.list.concat(list),
										showList: true
									});
								}
							} else {
								that.siteItemData.list = []
							}
						}).catch((err) => {
							uni.hideLoading()
						})
				} else {
					uni.hideLoading()

					this.showLocalService = app.globalData.userLocalStatus
					this.showList = true
				}

				console.log('首页app取得globalData.userLocalStatus是???', app.globalData.userLocalStatus)
			},

			// 关闭公告弹窗
			onClose: function(e, _dataset) {
				/* ---处理dataset begin--- */
				this.datasetHandle(e, _dataset);
				/* ---处理dataset end--- */
				// console.log("关闭公告弹窗~~~~~~",e, _dataset)
				// var index = e.currentTarget.dataset.index;
				var id = _dataset?.id || e?.currentTarget?.dataset?.id; // console.log(e,999)

				this.getListPopUp();
				if(id){
					this.updateMessageToHaveRead(id);
				}
				this.announcementStatus1 = false
				this.memberId = uni.getStorageSync('memberId')
			},

			onCloseCoupons: function() {
				this.showCoupons = false,
					this.showCoupons2 = true
			},

			onActivityClose: function() {
				console.log(999)
				this.showCoupons2 = false
			},

			//   我的订单
			naviToOrderList: function() {
				app.globalData.CHECK_LOGIN(function() {
					uni.navigateTo({
						url: '../../orderSub/pages/order/order'
					});
				});
			},

			getAdvertisingPopups: function() {
				var that = this;
				var tmp = this;
				https_1
					.getAdvertisingPopups({
						sellerNo: app.globalData.sellerNo,
						memberId: uni.getStorageSync('memberId')
					})
					.then(function(res) {
						if (res.code == 0) {
							if (res.data) {
								if (res.data.windowType.indexOf('3') > -1) {
									tmp.announcementStatus1 = true
									tmp.announcementTitle = res.data.name
									tmp.announcementBody = res.data.content
									tmp.linkUrl = res.data.linkUrl
									tmp.mobilePath = res.data.mobilePath
									tmp.announcementId = res.data.id
									tmp.linkType1 = res.data.linkType
								}
							} else {
								that.getListPopUp();
							}
						}
					});
			},

			getIsRead: function() {
				var that = this;
				https_1
					.isRread({})
					.then(function(res) {
						if (res.code == 0) {
							that.readStatus = res.data
						}
					})['catch'](function(err) {});
			},
			//获取信息展示红点状态 营销获客
			getIsReadYx() {
				// true-有未读消息,false-无未读消息
				https_1.isRread({})
					.then((res) => {
						console.log(res, '获取7100未阅读消息,true-有未读消息,false-无未读消息--------');
						if (res.code == 0) {
							if (res.data == true) {
								console.log('7100---------------------', res.data);
								this.setData({
									oldStatus: true
								});
							} else {
								this.setData({
									oldStatus: false
								});
								console.log('7100没有需要阅读的信息....');
							}

							//外包接口判断消息
							getMessageStatus({
									sellerId: app.globalData.sellerId
								})
								.then((res) => {
									// console.log(res, '获取8081外包未阅读消息,0是没有要阅读的,非0代表未阅读的数量--------');
									if (res.code == 200) {
										if (res.data > 0) {
											console.log('8081---------------------', res.data);
											this.setData({
												newStatus: true
											});
										} else {
											this.setData({
												newStatus: false
											});
											console.log('8081没有需要阅读的信息------------');
										}

										//新老接口一起判断阅读状态
										if (this.oldStatus == true || this.newStatus == true) {
											console.log(this.oldStatus, this.newStatus, '有未阅读信息啊..........');
											this.setData({
												readStatus: true
											});
										} else {
											this.setData({
												readStatus: false
											});
											console.log(this.oldStatus, this.newStatus, '合并起来后,没有需要阅读的信息....');
										}
									}
								})
								.catch((err) => {
									console.log(err);
								});
						} else {
							console.log('7100阅读接口报错了...');
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},
			getListPopUp: function() {
				var that = this;
				https_1
					.listPopUp()
					.then(function(res) {
						if (res.code == 0) {
							var activityData = res.data;
							var couponImgList_1 = [];

							if (activityData.length > 0) {
								activityData.forEach(function(element) {
									if (/^http/.test(element.imgUrl) && element.region == 1) {
										couponImgList_1.push({
											image: element.imgUrl,
											linkUrl: element.linkUrl,
											linkType: element.linkType,
											content: element.content,
											mobilePath: element.mobilePath,
											id: element.id,
											title: element.title,
											status: element.status,
											timeS: element.setupTime,
											marketingId: element.marketingId,
											activityType: element.activityType,
											appId: element.appId
										});
										that.couponImgList = couponImgList_1,
											that.showCoupons2 = true
									}
								});
							}
						}
					})['catch'](function(err) {
						console.log(err);
					});
			},

			naviActivity: function(e, type) {
				var item = e.currentTarget.dataset.item;
				console.log(item, '首页弹窗')
				this.getReadPopUp(item.id);
				if (item.linkType == 1) {
					util_1.LinkType(item.linkUrl);
				} else if (item.linkType == 2) {
					app.globalData.richText = item.content;
					if (type == 'shadePopup') {
						// 修复活动弹窗列表bug，因为item.status：2是发布中，跟其他活动冲突，所以手动将状态改成1
						uni.navigateTo({
							url: `../../homeSub/pages/advertisDetails/advertisDetails2?title=` + item.title +
								'&time=' + item.timeS + '&status=1'
						});
						return
					}
					uni.navigateTo({
						url: `../../homeSub/pages/advertisDetails/advertisDetails2?title=` + item.title +
							'&time=' + item.timeS + '&status=' + item.status
					});
				} else if (item.linkType == 4) {
					// 处理营销获客逻辑  
					this.disposeMarketingActivity(item.activityType, item.marketingId);
					this.getReadPopUp(item.id);
				} else if (item.linkType == 5) {
					util_1.LinkType(item.mobilePath);
				}	else if (item.linkType == 6) {
					let toParams = {}
					if (item.appId) {
						toParams = {
							appId: item.appId,
							path: item.linkUrl
						}
					} else {
						toParams = { shortLink: item.linkUrl }
					}
					wx.navigateToMiniProgram({
						...toParams,
						fail: err=>{
							console.error(err, item.appId, item.linkUrl);
						}
					})
				} else {
					return false;
				}
			},

			getReadPopUp: function(id) {
				var that = this;
				https_1
					.readPopUp({
						id: id
					})
					.then(function(res) {
						if (res.code == 0) {
							that.showCoupons2 = false
						}
					})['catch'](function(err) {
						console.log(err);
					});
			},

			naviLink: function(e) {
				var link = e.currentTarget.dataset.link;
				var mobilePath = e.currentTarget.dataset.mobilepath;
				var linkType = e.currentTarget.dataset.linktype1;

				if (linkType == 0) {
					if (/^http/.test(link)) {
						// #ifdef APP-PLUS  
						plus.runtime.openURL(link);
						// #endif
						// #ifdef H5
						window.location.href = link
						// #endif
						// #ifdef MP-WEIXIN || MP-ALIPAY
						uni.navigateTo({
							url: '../../components/webView/webView?link=' + link
						});
						// #endif
						this.announcementStatus1 = false
					}
				} else if (linkType == 5) {
					if (mobilePath) {
						uni.navigateTo({
							url: mobilePath
						});
						this.announcementStatus1 = false
					}
				}

			},

			updateMessageToHaveRead: function(id) {
				https_1
					.updateMessageToHaveRead(id)
					.then(function(res) {
						if (res.code == 0) {}
					})['catch'](function(err) {});
			},

			//选择距离
			checkDistance: function(e) {
				var key = e.currentTarget.dataset.key;
				this.setData({
					'memberQueryPreferenceDto.distance': key
				});
			},

			//选择站点类型
			checkSiteType: function(e) {
				var key = e.currentTarget.dataset.key;
				this.setData({
					'memberQueryPreferenceDto.stationType': key
				});
			},

			//选择充电模式
			checkChargingMode: function(e) {
				var key = e.currentTarget.dataset.key;
				this.setData({
					'memberQueryPreferenceDto.fastSlow': key
				});
			},

			//选择建设场所
			checkConstructionSite: function(e) {
				var key = e.currentTarget.dataset.key;
				this.setData({
					'memberQueryPreferenceDto.construction': key
				});
			},
			//选择有无优惠
			checkIsDiscount: function(e) {
				var key = e.currentTarget.dataset.key;
				this.setData({
					'memberQueryPreferenceDto.discount': key
				});
			},

			//清除偏好
			canalPreference: function() {
				this.setData({
					memberQueryPreferenceDto: {
						distance: null,
						fastSlow: null,
						stationType: null,
						construction: null,
						discount: null
					},
					page: 1,
				});
				// this.$refs.showPreferencePup.close()
				this.station('replace');
			},

			//确定偏好
			enterPreference: function() {
				this.setData({
					page: 1,
				});
				// this.$refs.showPreferencePup.close()
				this.station('replace');
			},

			onReachBottom: function() {
				// if(uni.getStorageSync('token')) {
				let page = this.page + 1;

				if (this.page < this.pages) {
					this.setData({
						page
					});
					this.station('');
				}
				// }
			},
			//账户信息
			getAccountInfo: function(menberType) {
				// menberType:0个人2车队
				let tab = menberType == 0 ? 1 : 2
				var that = this;
				https_1
					.getAccountInfo({
						tab
					})
					.then(function(res) {
						if (res.code == 0) {
							that.accountInfo = res.data
						}
					})
			},
		}
	};
</script>
<style lang="less" scoped>
	@import url("./index.less");

	@import url("./index2.less");

	.tabs_wrap {
		display: flex;
		align-items: center;
		position: sticky;
		top: 0;
		padding: 20rpx;
	}

	.tabs_item:not(:first-child) {
		margin-left: 20rpx;
	}

	.tabs_name {
		font-size: 32rpx;
		font-family: PingFang SC-Semibold, PingFang SC;
		font-weight: 600;
		color: #262626;
	}

	.tabs_name1 {
		font-size: 28rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #404040;
	}

	.tabs_active {
		display: block;
		width: 100%;
		height: 10rpx;
		background: var(--textColor);
	}
</style>